#pragma once

#include <vector>
#include "Enum.h"
#include <string>

class Scroll;
class Equipment;
class ItemStack;
class GameObject;
class Tile;
class Recipe;
class AvailableTalents;
class Player;

class Keyboard {
protected:
	int m_counter;
	void handlePickUp(char c = 0);
	void lockUnlock(int x, int y);
	void handleFilter(char key);
	void handlePortal(bool up);
	void handleScroll(Scroll* scroll);
	ItemStack* m_selectedItemStack;
	GameObject* m_selectedObject;
	Tile* m_selectedTile;
	EquipmentLocation m_selectedEquipmentLocation;
	Recipe* m_selectedRecipe;
	Scroll* m_selectedScroll;
	AvailableTalents* m_availableTalents;
	std::vector<std::string> m_loadGames;
	void deleteItemStack();
public:
	Keyboard();
	~Keyboard();
	static void handleInput(unsigned char key, int x, int y);
	static void handleSpecInput(int key, int x, int y);
	void handleInput(unsigned char key);
	void handleSpecInput(int key);
	ItemStack* getSelectedItemStack() const;
	GameObject* getSelectedObject() const;
	Tile* getSelectedTile() const;
	EquipmentLocation getSelectedEquipmentLocation() const;
	Recipe* getSelectedRecipe() const;
	void initTalentList(Player* player);
	AvailableTalents* getAvailableTalents() const;
	const std::vector<std::string>& getLoadGames() const;
	void resetKeyboard();
};

inline ItemStack* Keyboard::getSelectedItemStack() const {return m_selectedItemStack;}
inline GameObject* Keyboard::getSelectedObject() const {return m_selectedObject;}
inline Tile* Keyboard::getSelectedTile() const {return m_selectedTile;}
inline EquipmentLocation Keyboard::getSelectedEquipmentLocation() const {return m_selectedEquipmentLocation;}
inline Recipe* Keyboard::getSelectedRecipe() const {return m_selectedRecipe;}
inline AvailableTalents* Keyboard::getAvailableTalents() const {return m_availableTalents;}
inline const std::vector<std::string>& Keyboard::getLoadGames() const {return m_loadGames;}